package com.sugar.persistence.system.privilege.impl;

import java.util.LinkedHashMap;
import java.util.List;

import org.springframework.stereotype.Repository;

import com.sugar.common.base.persistence.IHibernateBaseDaoSupport;
import com.sugar.common.base.persistence.query.PageModel;
import com.sugar.domain.system.privilege.PrivilegeResourceModel;
import com.sugar.persistence.system.privilege.IPrivilegeResourceModel;

@Repository
public class PrivilegeResourceModelDao extends IHibernateBaseDaoSupport<PrivilegeResourceModel> implements IPrivilegeResourceModel{

	@Override
	public void deletePRModelDao(PrivilegeResourceModel prm)
			throws RuntimeException {
		this.deleteEntityBaseDao(prm) ;
	}

	@Override
	public void deleteSelectPRModelDao(Object[] ids) throws RuntimeException {
		this.deleteEntityMoreIdBaseDao(PrivilegeResourceModel.class, ids) ;
	}

	@Override
	public List<PrivilegeResourceModel> findPRModelDao(String queryString,
			String whereStr, Object[] param,
			LinkedHashMap<String, String> orderby) throws RuntimeException {
		
		return this.findMoreEntityByParam(queryString, null, param, orderby) ;
	}

	@Override
	public PageModel<PrivilegeResourceModel> getScorllPRModelDao(
			String queryString, String whereStr, Object[] param, int firstPage,
			int pageSize, LinkedHashMap<String, String> orderby)
			throws RuntimeException {
		
		return this.getScrollRecord(queryString, null, null, firstPage, pageSize) ;
	}

	@Override
	public PrivilegeResourceModel loadPRModelByIdDao(int id)
			throws RuntimeException {
		
		return this.loadEntityById(PrivilegeResourceModel.class, id) ;
	}

	@Override
	public void savePRModelDao(PrivilegeResourceModel prm)
			throws RuntimeException {
		this.saveEntityBaseDao(prm) ;
	}

	@Override
	public void updatePRModelDao(PrivilegeResourceModel prm)
			throws RuntimeException {
		this.updateEntityBaseDao(prm) ;
	}

}
